package com.itheima.sh.dao;

import com.itheima.sh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface UserDao {
    //登录功能（根据用户名和密码查询用户是否存在）
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(User user);

    //根据用户名查询用户是否存在
    @Select("select*from user where username=#{username}")
    User queryUserByName(String username);

    //添加用户
    @Insert("insert into user values(null,#{username},#{password})")
    void insertUser(User user);
}
